﻿using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data.SqlClient;
using System.Data;
using BLL.BusinessLayer;
using BLL.BusinessLayer.DataLayer;


/// <summary>
/// Summary description for WSApps
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WSApps : System.Web.Services.WebService {
    public WSApps () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string HelloWorld() {
        return "Hello World";
    }
    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    [WebMethod(Description = "Apps_GetAllToDataSet", EnableSession = false)]
    public DataTable Apps_GetAllToDataSet()
    {
        DataSet ds = new DataSet();
        DataTable dt = new DataTable();
        try
        {
            BLL.BusinessLayer.DataLayer.ClsApps_PlatsSql fa = new ClsApps_PlatsSql();
            ds = fa.GetAllToDataSet();
            dt = ds.Tables[0];
            return dt;
        }
        catch (System.Exception ex) { }
        return dt;
    }

    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    [WebMethod(Description = "SelectByFieldToDataSet", EnableSession = false)]
    public DataTable SelectByFieldToDataSet(string fieldName, object value)
    {
        DataSet ds = new DataSet();
        DataTable dt = new DataTable();
        try
        {
            BLL.BusinessLayer.DataLayer.ClsApps_PlatsSql fa = new  ClsApps_PlatsSql();
            ds = fa.SelectByFieldToDataSet(fieldName, value);
            dt = ds.Tables[0];
            return dt;
        }
        catch (System.Exception ex) { }
        return dt;
    }
    

}

